<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 小div在大div中绝对居中（水平和垂直方向都居中） */
        .box {
            width: 400px;
            height: 400px;
            border: solid;
            position: relative;
        }
        .son{
            width: 100px;
            height: 100px;
            border: 1px solid red;
            position: absolute;
            top: calc(50% - 50px);
            left: calc(50% - 50px);
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="son"></div>
    </div>
</body>
</html>